Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: more conservative stalled download check, better logging #884

Merged
merged 7 commits into from
Jul 9, 2020

Conversation

brandonocasey
Copy link
Contributor

This was brought up because some of our users were seeing stalled download exclusions for playlists that were not stalled.

});

// after 5 possibly stalled appends with no reset, exclude
if (this[`${type}StalledDownloads_`] < 5) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait until 5 stalled downloads.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use a larger value here. Would 10 be ok? Maybe 15 or even 20?

@@ -2492,6 +2491,8 @@ export default class SegmentLoader extends videojs.EventTarget {
return;
}

this.trigger('appendsdone');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't report aborted appends as appends

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know in what instances we will abort appends? It seems like it would only happen on dispose of the source buffers, otherwise appends will continue even if the current segment loader process is aborted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's the request itself in this case that is aborted, rather than an actual append. I was seeing it with aggressive network throttling and changing renditions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth us adding a test for this case.

@@ -2492,6 +2491,8 @@ export default class SegmentLoader extends videojs.EventTarget {
return;
}

this.trigger('appendsdone');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know in what instances we will abort appends? It seems like it would only happen on dispose of the source buffers, otherwise appends will continue even if the current segment loader process is aborted.

@@ -744,7 +744,7 @@ export const setupMediaGroups = (settings) => {
mediaTypes.AUDIO.onTrackChanged();
}

masterPlaylistLoader.on('mediachange', () => {
masterPlaylistLoader.on(['mediachange', 'mediachanging'], () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we worry about this causing double aborts in some cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After some testing, this will cause a second abort on mediachange but the segmentLoader was already in an aborted state and nothing bad happens. After some more thought though I wonder if we should stopLoaders and resync/reset on mediachanging and then startLoaders on mediachange going to see how that works

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure where you're at, but an alternative is to skip this change for the PR for right now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I gave myself until the end of today to try to solve it, just about to push up a commit that takes it out and fixes the tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This took so long because this change seemed to cause other race condition issues and debugging it is quite difficult. Ultimately I think we still want some kind of fix, but it an edge case so we can probably just document it and skip for now.

@gkatsev gkatsev added this to the 2.1 milestone Jul 6, 2020
gkatsev
gkatsev previously approved these changes Jul 7, 2020
gkatsev
gkatsev previously approved these changes Jul 8, 2020
src/media-groups.js Outdated Show resolved Hide resolved
@gkatsev gkatsev merged commit 615e77f into main Jul 9, 2020
@gkatsev gkatsev deleted the fix/better-stalled branch July 9, 2020 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants